Skip to content

TypeError: Cannot set property data of #<Object> which has only a getter fix#649

Merged
dougwilson merged 1 commit into
expressjs:masterfrom
eoL95:feature/cookie-fix
Apr 11, 2019
Merged

TypeError: Cannot set property data of #<Object> which has only a getter fix#649
dougwilson merged 1 commit into
expressjs:masterfrom
eoL95:feature/cookie-fix

Conversation

@eoL95
Copy link
Copy Markdown
Contributor

@eoL95 eoL95 commented Apr 11, 2019

Hello. In new release you have an error:
TypeError: Cannot set property data of #<Object> which has only a getter

So, this happened because you've changed this code
image
But in your cookie.js file strict mode is enabled. That is the reason why JS throws an error.
So I think the better way is to define setter for data field in prototype.

@eoL95 eoL95 changed the title Add setter for data TypeError: Cannot set property data of #<Object> which has only a getter fix Apr 11, 2019
Copy link
Copy Markdown
Contributor

@dougwilson dougwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a test to prevent regression (test for the original error). I can help create the test if you have steps to reproduce.

Comment thread test/cookie.js Outdated
Comment thread session/cookie.js Outdated
@dougwilson dougwilson self-assigned this Apr 11, 2019
dougwilson pushed a commit to eoL95/session that referenced this pull request Apr 11, 2019
@dougwilson dougwilson merged commit 1e3fc39 into expressjs:master Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants